package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class UserRegParam {

    //@NotNull(message = "用户名不能为null")
    //@NotEmpty(message = "用户名不能为null和空字符串")
    //@NotBlank(message = "用户名不能为null和空字符串和空白串")
    //@Size(min = 6, max = 12, message = "用户名长度必须在6到12之间")

    @Pattern(regexp = "^([a-zA-Z]{1,14}|[\\u4e00-\\u9fa5]{1,7})$", message = "用户名最长为14个英文或7个汉字")
    @Schema(description = "用户名",  required = true,  example = "lucy")
    private String username;
    @Pattern(regexp = "^[a-zA-Z0-9]{6,12}$", message = "密码长度必须在6到12之间")
    @Schema(description = "密码",  required = true,  example = "123456")
    private String password;
    @Email(message = "邮箱格式不正确")
    @Schema(description = "邮箱",  required = true,  example = "lucy@163.com")
    private String email;
    @Schema(description = "手机号",  required = true,  example = "13111112222")
    private String phone;
}
